#!/bin/env perl

use strict;
use warnings;

my $string = "-" x 1000;
$string =~ s/(?!(-{2,})\1{1,}$)(?!-{1,2}$)(?=(-+))/print length($2), "\n"/eg;
